<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>监控测试</title>
    <script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script>
    <script src="index.browser.js"></script>
    <script>
      const __MONITOR_SDK__ = window.__MONITOR_SDK__({
        appId: "fb2b6f18-43ed-49f3-8dd5-d0fe6039435e",
        userId: "bb4788e8f400e9c9f48de819c0e00d93",
        debug: false,
        jsErrorLog: true,
        promiseErrorLog: true,
        resourcesErrorLog: true,
        whiteScreenLog: true,
        exposureLog: true,
        fullEventLog: false,
        lengthOfStayLog: true,
        pvLog: true,
        perfLog: true,
        resourcesPerfLog: true,
        xhrLog: true,
        reportUrl: "http://192.168.3.16:7001/api/report/tracker/push",
      });
    </script>
    <script
      crossorigin
      src="https://unpkg.com/vue@3/dist/vue.global.js"
    ></script>
  </head>

  <body>
    <input type="text" name="record" value="沙发" />
    <button id="jsError">jsError</button>
    <button id="promiseError">promiseError</button>
    <button onclick="addDom()">addDom</button>
    <button onclick="http()">http</button>
    <div appear="appear1">1</div>
    <div appear="appear2">2</div>
    <div style="height: 100vh; background: rgb(11, 145, 100)"></div>
    <div appear="appea3">3</div>

    <audio
      src="xxx.mp3"
      controls="controls"
      autoplay="autoplay"
      loop="loop"
    ></audio>
    <video
      src="xxx.mp4"
      autoplay="autoplay"
      controls="controls"
      loop="loop"
    ></video>
  </body>
  <script>
    document.querySelector("#jsError").onclick = () => {
      a.x;
    };
    document.querySelector("#promiseError").onclick = () => {
      new Promise((resolve, reject) => {
        a.x;
      });
    };
    function addDom() {
      const body = document.body;
      const div = document.createElement("div");
      div.innerHTML = "动态节点曝光";
      div.style = "background-color: #f60";
      div.setAttribute("appear", "appear4");
      body.insertBefore(div, body.firstChild);
      __MONITOR_SDK__.exposureRefresh();
    }

    function http() {
      // TODO:场景覆盖
      axios.get("http://127.0.0.1:9001/user111", {
        params: {
          ID: 12345,
        },
      });
      axios.get("http://127.0.0.1:9001/user111?ID=12345");
      axios.post("http://127.0.0.1:9001/user", {
        firstName: "Fred",
        lastName: "Flintstone",
      });
    }
  </script>
  <script src="test.js"></script>
  <script src="greyTest.js"></script>
  <link rel="stylesheet" href="testx.css" />
  <img src="ss.png" alt="" />
</html>
